<div hint-msg hintdate="hintdate"></div>

<div class="paper-b m8 p16 bg-tran c-grey-d" ng-if="!isFarmer">
    <h4>小贴士</h4>
    <p class="fs12 pt8 pb16">参与招募小农场主活动，即可拥有自己的农场。</p>
    <div class="ta-r">
        <button ui-sref="activity.farmer" class="btn bg-blue">成为小农场主</button>
    </div>
</div>
<div class="mb24" ng-repeat="farm in farms">
    <div class="paper-b m8">
        <div class="lh0 p-r">
            <img class="w-full" src="./images/plant.jpg" alt="">
            <div class="const plr8 ptb4 bg-orange c-text-w lh16"><span>我的农场</span></div>
        </div>
        <table class="table table-condensed table-hover table-striped mt8">
            <thead>
                <tr>
                    <th>详情</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>菜地编号</td>
                    <td ng-bind="farm.farmId"></td>
                </tr>
                <tr>
                    <td>农场到期时间</td>
                    <td ng-bind="date_transfer(farm.expireDate)"></td>
                </tr>
                <tr>
                    <td>管理费至</td>
                    <td ng-bind="date_transfer(farm.cropManageExpire)"></td>
                </tr>
            </tbody>
        </table>
        <table class="table table-condensed table-hover table-striped mt8">
            <thead>
                <tr>
                    <th>作物</th>
                    <th>成熟时长/天</th>
                    <th>播种日期</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="crop in farm.myCrops">
                    <td ng-bind="crop.cropName"></td>
                    <td ng-bind="crop.grownDay"></td>
                    <td ng-bind="date_transfer(crop.addTime)"></td>
                </tr>
            </tbody>
        </table>
        <div class="plr16">
            <p class="pt16 c-hint-b fs12">作物成熟之后还可以继续播种喔。</p>
            <div class="j-box">
                <div class="checkbox-box-imgstyle mt16" ng-repeat-start="green in farm.myCrops">
                    <input id="{{'Seed' + green.id}}" type="checkbox" name="greens" value="2" class="d-n">
                    <label for="{{'Seed' + green.id}}" class="checkbox-imgstyle">
                        <img src="{{green.cropModel.image}}" alt="">
                        <p ng-bind="green.cropName"></p>
                        <!-- <div class="checkbox-mark"><span>✓</span></div> -->
                        <div class="const plr8 ptb4 bg-green c-text-w lh16 fs12"><span ng-bind="crop_status(green.cropStatus)"></span></div>
                    </label>
                </div>
                <!-- angular ng-repeat justify hacking -->
                <div class="d-il" ng-repeat-end ng-if="false"></div>
                <button class="w90 h90 d-il bg-tran seed-add" ng-if="buy_crop(this.farm.buyCrop)" ng-click="add_seed(this.farm)">
                    <span>+</span>
                </button>
                <div class="w90 d-il"></div>
                <div class="w90 d-il"></div>
                <div class="w90 d-il"></div>
                <div class="w90 d-il"></div>
                <div class="j-h"></div>
            </div>
        </div>
        <div class="ta-r p16">
            <button class="btn-hollow c-hint-b">联系农场</button>
            <button class="btn-hollow c-green ml8" ng-click="pay_manage(this.farm.id)">续交管理费</button>
        </div>
    </div>
    <!-- <div class="mlr8">
        <button class="btn-flex w-full bg-green c-text-w shadow fs16">我要农庄代管</button>
    </div> -->
</div>
<div btm-pay paydata="paydata"></div>
<style>
.const {
    position: absolute;
    top: 0;
    right: 0;
    border-radius: 2px;
}

.seed-add {
    margin-top: 16px;
    color: #fff;
    line-height: 90px;
    text-align: center;
    font-size: 32px;
    vertical-align: top;
    border: none;
}
</style>
